package org.neusoft.auth.service.impl;

import org.neusoft.auth.entity.CommonResult;
import org.neusoft.auth.entity.Dept;
import org.neusoft.auth.entity.Emp;
import org.neusoft.auth.mapper.DeptMapper;

import org.neusoft.auth.service.DeptService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    DeptMapper deptMapper;


    public CommonResult all() {
        List<Dept> lds = null;
        CommonResult result = new CommonResult<List>(lds);
        try {
            lds = deptMapper.all();
        }
        catch (Exception ex ){
            result.setStatus(500);
            result.setMsg("INTERNAL SERVER ERROR");

        }
        result.setData(lds);
        return result;
    }


}
